import { ref } from 'vue'
// 弹出层操作
export default function useToast() {
	
  const isShowToast = ref(false)
  const toastConfig = ref({})
  const showToast = (parmas)=>{
	isShowToast.value = true
	if(typeof(parmas) == 'string'){
		toastConfig.value = {
			showConfirm:true,
			message:parmas
		}
	}else if(typeof(parmas) == 'object'){
		toastConfig.value = {
			showConfirm:true,
			...parmas
		}
	}
  	
  }
  const hideToast = ()=>{
  	isShowToast.value = false
  }
  return {
    isShowToast,
    toastConfig,
    showToast,
    hideToast
  }
}